package tazadum.engine.trigger;

public class GreaterThanTrigger implements Trigger {
	private final float limit;
	private float state;

	public GreaterThanTrigger(final float limit, final float state) {
		this.state = state;
		this.limit = limit;

	}

	@Override
	public boolean trigger(final float value) {
		if (state > limit) {
			state = value;
			return false;
		}
		state = value;
		if (value > limit) {
			return true;
		}
		return false;
	}

}
